Hello gr8 DXL developers, |
Re: Value of Object number of a new object without Object header Are you sure that the text is in the correct attribute - it should be in the "Object Text" attribute and the "Object Heading" attribute should be empty. Are you absolutely sure that the "Object Heading" attribute is empty and does not contain any hidden white space characters? Is the displayed object number above the text like that shown below? 1.1.1 Text appears here below the Object Number or is the displayed object number next to the text like that shown below? 1.1.1 Text appears here next to the Object Number Can you tell us what version of DOORS your are using and also show your DXL code so that we can see where the problem might be? Paul Miller, Melbourne, Australia |
Re: Value of Object number of a new object without Object header I create an object and i want it to be Info so I don't want it to have Object number in the hierarchy Here is my code : void methodA(Object object){ object = create below current object = current ObjectTypeText = object.ObjectType if( ObjectTypeText == "Info Obj"){ object.ObjectHeading = null } } So i already overwrite any value in the object heading to ensure that it doesn't have an empty space. About your question the first option is the one that I have Thanks a million for your quick reply :) Best Regards |
Re: Value of Object number of a new object without Object header The displayed object number next to the text like that shown below: 1.1.1 Text appears here next to the Object Number |
Re: Value of Object number of a new object without Object header DXL - Thu Sep 06 10:37:06 EDT 2012
When you create a new object it will always appear to be a "heading" as far as the main "Object Heading and Text" column is conserned. Specifically, all "empty" objects (no heading/text/ole/picture) appear in that standard column AND the paragraph number's last field will look like ".n" and not like ".0-n" (like "3.1.1" not "3.1-0.1"). This is true whether you create the object "after" or "below", with the GUI or with DXL. Imported and pasted and copied objects not only get created but their attributes are usually populated, so the final object number may not follow these rules.
Object methodA(Object oCurr){
// Create a new object below oCurr.
// When oCurr is an "Info Obj" then the new object should be a text object.
Object oNew = create below oCurr
string ObjectTypeText = oCurr.ObjectType
if( ObjectTypeText == "Info Obj") then oNew."Object Text" = " " // Display oNew as Text object
return(oNew)
}
Object oPopulate = methodA(current Object)
oPopulate."MyRandomAttr" = "whatever"
Otherwise it displays as a DOORS Heading.
|
Re: Value of Object number of a new object without Object header Thank you for ur reply but actually the method I wrote is just a part of a large file. so I exctracted from it what i believed will clarify my question. About making the "Object Text" empty ..well I don't want it empty..I need to write some description on it. I want to have a new object with no Object Header and object Number (above.0-1) and have Object Text So any other suggestion? BTW I use doors 9.2 Best Regards |
Re: Value of Object number of a new object without Object header DXL - Sun Sep 09 04:10:53 EDT 2012
Well actually its pretty straightforward. It might be a problem with your code, since you are using the variables very weirdly:
// do not call a variable 'object' like the object perm.
void methodA(Object object){
// Use a NEW variable for the newly created object, do not overwrite the parameter
object = create below current // why use current?? You might want to use 'object' here
// Do you want to change object to be the OLD current object, i.e. the parent of the newly created object?
object = current // This will so nothing, since the current Object will change to be the newly created object!
ObjectTypeText = object.ObjectType // So: You are reading the text of the newly created object, which is empty!
if( ObjectTypeText == "Info Obj") { // Therefore this will never be executed!
object.ObjectHeading = null // It also does not make a lot of sense
}
}
Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS
|
Re: Value of Object number of a new object without Object header THANKS ALL FOR YOUR HELP |